-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update for Pydantic v2 #1381
Update for Pydantic v2 #1381
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1381 +/- ##
==========================================
+ Coverage 88.49% 88.57% +0.07%
==========================================
Files 77 77
Lines 10492 10493 +1
==========================================
+ Hits 9285 9294 +9
+ Misses 1207 1199 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
72ae5bf
to
f256a55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks LGTM to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@yarikoptic What was the timeline on getting this merged/released? |
Originally planned right after coming back from holidays, but that fell through. |
@yarikoptic Various tests are currently failing because the Archive doesn't yet accept schema version 0.6.5. |
@jwodder - could we TEMP test against version in
|
@yarikoptic Testing in dandi-cli requires a Docker image of the Archive PR. It would be easier to instead add a temporary commit in the Archive PR for running the CLI integration tests against this PR. |
|
||
If ``path`` is already an absolute URL, it is returned unchanged. | ||
""" | ||
if path.lower().startswith(("http://", "https://")): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function name and description suggests being applicable to URL of any transport, not just https so better be smth like
if path.lower().startswith(("http://", "https://")): | |
if re.match('[a-z]+://', path.lower()): |
to avoid surprises.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but also how it is different from a standard urllib's join?
In [3]: urllib.parse.urljoin('http://a.c/', '/1/2/3')
Out[3]: 'http://a.c/1/2/3'
In [4]: urllib.parse.urljoin('http://a.c/', 's3://1/2/3')
Out[4]: 's3://1/2/3'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
The function is only meant for HTTP(S) URLs.
-
It differs from
urljoin()
for URLs that have a path that doesn't end in/
:>>> urljoin("https://example.com/foo/bar", "quux") 'https://example.com/foo/quux'
joinurl()
would instead givehttps://example.com/foo/bar/quux
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- then better name it
httpurljoin
or at least describe it in its description - also please add into description this difference in behavior as rationale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: 728882f
🚀 PR was released in |
Closes #1352.
Blocked by dandi/dandi-archive#1820.Do not merge until after dandi/dandi-schema#203 is merged & released. Once that is done, the "[TEMP] Use Pydantic 2.0 branch of dandischema" commit in this PR should be replaced with a commit that sets the[Done]dandischema
version requirement to~= 0.9.0
instead.